﻿/*  
 * Helix Engine
 * http://helixengine.codeplex.com/
 * 
 * Copyright (c) 2010 - 2011 Joe Hegarty
 *  
 * This source code is subject to the terms of the Microsoft Public License (Ms-PL). 
 *  
 * Redistribution and use in source and binary forms, with or without modification, 
 * is permitted provided that redistributions of the source code retain the above 
 * copyright notices and this file header. 
 * 
 * For details please see http://www.opensource.org/licenses/ms-pl.html 
 *  
 * All other rights reserved. 
 *
 */  


using System;
using System.Collections.Generic;

namespace HelixEngine.Render
{
    internal class DepthSorter : IComparer<QueuedRender>
    {
        public int Compare(QueuedRender x, QueuedRender y)
        {
            if (x.ZIndex < y.ZIndex)
            {
                return -1;
            }
            else if (x.ZIndex > y.ZIndex)
            {
                return 1;
            }

            // Must be the same
            return 0;
        }
    }
}
